package server;

public class HttpProtocolUtil {

    /**
     * 为响应码200提供响应头信息
     * @return
     */
    public static String getHttpHeader200 (long contentLength) {
        return "HTTP/1.1 200 OK \n" +
//                "Content-Encoding: gzip\n" +
                "Content-Type: text/html;charset=utf-8\n" +
                "Content-Type: " + contentLength + "\n" +
                "\r\n";
    }

    /**
     * 为响应码200提供响应头信息
     * @return
     */
    public static String getHttpHeader404 () {
        String str404 = "<h1>404 Not Found</h1>";
        return "HTTP/1.1 404 Not Found \n" +
//                "Content-Encoding: gzip\n" +
                "Content-Type: text/html;charset=utf-8\n" +
                "Content-Type: " + str404.length() + "\n" +
                "\r\n" + str404;
    }


}
